const { defineConfig } = require('@vue/cli-service')
const { VantResolver } = require('unplugin-vue-components/resolvers');
const ComponentsPlugin = require('unplugin-vue-components/webpack');
let path = require("path")
module.exports = defineConfig({
  transpileDependencies: true,
  // 关闭严格模式
  lintOnSave: false,//是否使用eslint 默认true
  // 代理
  devServer:{
    proxy:{
      '/api':{
        target:"http://localhost:4000",
        changeOrigin:true,
        pathRewrite:{
          '^/api':'/api'//自己写的接口需以/api为前缀
        }
      }
    }
  },
  // @
  configureWebpack:(config)=>{
    config.resolve={
      extensions:['.js','.json','.vue'],
      alias:{
        '@':path.resolve(__dirname,'./src'),
      }
    }
  },
  
  configureWebpack: {
    plugins: [
      ComponentsPlugin({
        resolvers: [VantResolver()],
      }),
    ],
  },
 
  pwa: {
    iconPaths: {
      favicon32: 'favicon.ico',
      favicon16: 'favicon.ico',
      appleTouchIcon: 'favicon.ico',
      maskIcon: 'favicon.ico',
      msTileImage: 'favicon.ico'
              } 
           }

})
